home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / ArrangeScript / Sources / inlineCallbacks.h < prev    next >
Text File  |  1996-06-21  |  25KB  |  502 lines

  1. /*
  2.     This file contains inline wrappers to make plugin code a little easier to read
  3.     Note this assumes that there is an instance variable defined as:
  4.         const ArrangeCallbackTbl* calls; // callback table
  5.     like the one maintained in the base class 'Plugin'. Plugin.h includes this
  6.     file as part of the 'Plugin' class definition, so you won't need to unless
  7.     you're not decended from the 'Plugin' class.
  8.  
  9.     Additonally, if the comiler you're using allows you to turn off inlining
  10.     (like Codewarrior does, for instance) you can easily profile the time
  11.     the plugin is spending inside Arrange, without incurring the performance
  12.     cost of using wrapper functions in shipping code.
  13.  
  14.     Paul Chambers, March 12th, 1995.
  15. */
  16.  
  17. /* The callback functions available for manipulating modules themselves. */
  18.     
  19.     inline     ModuleID    FindModuleName (const char* name, uInteger minVers)
  20.         { return calls->modMgr->FindModuleName (name, minVers); };
  21.     inline     ModuleID    FindModuleID (uInteger id, uInteger minVers)
  22.         { return calls->modMgr->FindModuleID ( id, minVers); };
  23.     inline     const ModuleInfo*    GetModInfo (pModuleID module)
  24.         { return calls->modMgr->GetModInfo ( module); };
  25.     inline     OSErr        OpenModFile (const FSSpec *file, pShort fileRefnum)
  26.         { return calls->modMgr->OpenModFile ( file, fileRefnum); };
  27.     
  28.     inline     ModuleEntryPoint  GetModuleEntry (pModuleID module, uInteger entryID)
  29.         { return calls->modMgr->GetModuleEntry ( module, entryID); };
  30.     inline    ProcPtr        ModuleCallPrelude ( const ModuleEntryPoint *entry,
  31.                                                           ModuleParamBlock *pb)
  32.         { return calls->modMgr->ModuleCallPrelude ( entry, pb); };
  33.     inline    void        ModuleCallEpilogue ( const ModuleEntryPoint *entry,
  34.                                              const ModuleParamBlock *pb)
  35.         { calls->modMgr->ModuleCallEpilogue ( entry, pb); };
  36.  
  37. /* The callback functions available for memory allocation and management. */
  38.     
  39.     inline    void* AllocMem ( uInteger size, AllocMode mode )
  40.         { return calls->mem->AllocMem ( size, mode ); };
  41.     inline    void DeallocMem ( void* block, AllocMode mode )
  42.         { calls->mem->DeallocMem ( block, mode ); };
  43.     inline    uInteger MemAvailable ()
  44.         { return calls->mem->MemAvailable (); };
  45.  
  46. /* various utility callback functions. */
  47.  
  48.     inline    const char* GetRString (pShort rsrcID, pShort stringIndex)
  49.         { return calls->util->GetRString ( rsrcID, stringIndex); };
  50.     inline    void        LowerString (char* string, Integer length)
  51.         { calls->util->LowerString ( string, length); };
  52.  
  53. /* The callback functions available for debugging purposes.
  54.     Note: only available if the application has been compiled for module debugging. */
  55.     inline    void PrintToLog (const char* message)
  56.         { calls->dbg->PrintToLog (message); };
  57.  
  58. /* The callback functions for manipulating fields. */
  59.  
  60.     // get field's value
  61.     inline     Integer        GetFieldTextLen (arNoteID note, arFieldID field)
  62.         { return calls->data->GetFieldTextLen (note, field); };
  63.     inline     Integer        GetFieldText ( arNoteID note, arFieldID field,
  64.                                         Integer bufLen, void* buffer)
  65.         { return calls->data->GetFieldText ( note, field, bufLen, buffer); };
  66.     inline     arDate        GetFieldDate (arNoteID note, arFieldID field)
  67.         { return calls->data->GetFieldDate (note, field); };
  68.     inline     arFloat        GetFieldNumber (arNoteID note, arFieldID field)
  69.         { return calls->data->GetFieldNumber (note, field); };
  70.     
  71.     inline     Integer        GetFieldListLen (arNoteID note, arFieldID field)
  72.         { return calls->data->GetFieldListLen (note, field); };
  73.     inline    arNoteID    GetFieldListEntry ( arNoteID note, arFieldID field, Integer index )
  74.         { return calls->data->GetFieldListEntry ( note, field, index); };
  75.     inline     arListID    GetFieldList (arNoteID note, arFieldID field)
  76.         { return calls->data->GetFieldList (note, field); };
  77.     
  78.     inline     PicHandle    GetFieldPict (arNoteID note, arFieldID field)
  79.         { return calls->data->GetFieldPict (note, field); };
  80.     inline     Handle        GetFieldAlias (arNoteID note, arFieldID field)
  81.         { return calls->data->GetFieldAlias (note, field); };
  82.     
  83.     // set field's value
  84.     inline    void SetFieldText ( arNoteID note, arFieldID field,
  85.                                 const char* text, Integer textLen, arSetFieldFlags flags)
  86.         { calls->data->SetFieldText ( note, field, text, textLen, flags); };
  87.     inline    void SetFieldDate ( arNoteID note, arFieldID field,
  88.                                 arDate date, arSetFieldFlags flags)
  89.         { calls->data->SetFieldDate ( note, field, date, flags); };
  90.     inline    void SetFieldNumber ( arNoteID note, arFieldID field,
  91.                                 const arFloat *number, arSetFieldFlags flags)
  92.         { calls->data->SetFieldNumber ( note, field, number, flags); };
  93.     inline    void SetFieldList ( arNoteID note, arFieldID field,
  94.                                 arListID list, arSetFieldFlags flags)
  95.         { calls->data->SetFieldList ( note, field, list, flags); };
  96.     inline    void AddListFieldEntry ( arNoteID note, arFieldID field,
  97.                                      Integer index, arNoteID childNote,
  98.                                      arSetFieldFlags flags)
  99.         { calls->data->AddListFieldEntry ( note, field, index, childNote, flags); };
  100.     inline    void DeleteListFieldEntry ( arNoteID note, arFieldID field,
  101.                                         arNoteID childNote, arSetFieldFlags flags)
  102.         { calls->data->DeleteListFieldEntry ( note, field, childNote, flags); };
  103.     inline    void MoveListFieldEntry ( arNoteID note, arFieldID field,
  104.                                         arNoteID childNote, Integer index,
  105.                                         arSetFieldFlags flags)
  106.         { calls->data->MoveListFieldEntry ( note, field, childNote, index, flags); };
  107.     inline    void SetFieldPict ( arNoteID note, arFieldID field,
  108.                                         PicHandle pict, arSetFieldFlags flags)
  109.         { calls->data->SetFieldPict ( note, field, pict, flags); };
  110.     inline    void SetFieldAlias ( arNoteID note, arFieldID field,
  111.                                         Handle alias, arSetFieldFlags flags)
  112.         { calls->data->SetFieldAlias ( note, field, alias, flags); };
  113.  
  114.     // Functions added in version 2 of DataCalls record
  115.     inline     void ReplaceFieldText ( arNoteID note, arFieldID field,
  116.                                         Integer repStart, Integer repEnd,
  117.                                         const char* insText, arSetFieldFlags flags)
  118.         { calls->data->ReplaceFieldText ( note, field, repStart, repEnd, insText, flags); };
  119.     inline     Integer GetFieldStyle ( arNoteID note, arFieldID field,
  120.                                         arFieldStyle* fieldStyle, Integer bufLen,
  121.                                         arCharStyle* charStyles)
  122.         { return calls->data->GetFieldStyle ( note, field, fieldStyle, bufLen, charStyles); };
  123.     inline     void    SetFieldStyle ( arNoteID note, arFieldID field,
  124.                                         const arFieldStyle* fieldStyle,
  125.                                         Integer charStyleCount, const arCharStyle* charStyles,
  126.                                         arSetFieldFlags flags)
  127.         { calls->data->SetFieldStyle ( note, field, fieldStyle, charStyleCount, charStyles, flags); };
  128.  
  129.  
  130. /* The callback functions for creating and destroying notes and managing their fields. */
  131.     
  132.     inline     arNoteID     CreateNote ( arTypeID type, pBoolean doGather)
  133.         { return calls->notes->CreateNote ( type, doGather); };
  134.     inline     arNoteID     DuplicateNote ( arNoteID note, pBoolean doGather)
  135.         { return calls->notes->DuplicateNote ( note, doGather); };
  136.     inline     void         ConvertNote ( arNoteID note, arTypeID type, pBoolean doGather)
  137.         { calls->notes->ConvertNote ( note, type, doGather); };
  138.     inline     void         DestroyNote ( arNoteID note)
  139.         { calls->notes->DestroyNote ( note); };
  140.     
  141.     inline     void         AddField ( arNoteID note, arFieldID field, arFieldID nextField)
  142.         { calls->notes->AddField ( note, field, nextField); };
  143.     inline     void         RemoveField ( arNoteID note, arFieldID field)
  144.         { calls->notes->RemoveField ( note, field); };
  145.     inline     void         HideField ( arNoteID note, arFieldID field)
  146.         { calls->notes->HideField ( note, field); };
  147.     inline     void         MoveField ( arNoteID note, arFieldID field, arFieldID nextField)
  148.         { calls->notes->MoveField ( note, field, nextField); };
  149.     
  150.     inline     Integer     CountNoteFields ( arNoteID note)
  151.         { return calls->notes->CountNoteFields ( note); };
  152.     inline     arFieldID GetNoteField ( arNoteID note, Integer index)
  153.         { return calls->notes->GetNoteField ( note, index); };
  154.     inline     Boolean     NoteHasField ( arNoteID note, arFieldID field, pBoolean onlyIfVisible)
  155.         { return calls->notes->NoteHasField ( note, field, onlyIfVisible); };
  156.     
  157.     inline     Boolean     NoteExists ( arNoteID note)
  158.         { return calls->notes->NoteExists ( note); };
  159.     inline     arTypeID     GetNoteType ( arNoteID note)
  160.         { return calls->notes->GetNoteType ( note); };
  161.     
  162.     inline     void         GetNoteInfo ( arNoteID note, arNoteInfo *info)
  163.         { calls->notes->GetNoteInfo ( note, info); };
  164.     inline     void         SetNoteInfo ( arNoteID note, const arNoteInfo *info)
  165.         { calls->notes->SetNoteInfo ( note, info); };
  166.  
  167. /* The callback functions for inspecting and altering the selection. */
  168.  
  169.     inline arWindowID    GetActiveWindow ()
  170.         { return calls->sel->GetActiveWindow (); };
  171.     
  172.     inline arSelType GetSelection ( arNoteID *note, arFieldID *field,
  173.                                         Integer *selStart, Integer *selEnd)
  174.         { return calls->sel->GetSelection ( note, field, selStart, selEnd); };
  175.     inline arPathID    GetSelPath ( )
  176.         { return calls->sel->GetSelPath ( ); };
  177.     inline     void        GetSelEntry ( Integer index, arNoteID *note,
  178.                                         arFieldID *field, arNoteID *parentNote)
  179.         { calls->sel->GetSelEntry ( index, note, field, parentNote); };
  180.     
  181.     inline     void        SelectObject ( arNoteID parent, arFieldID field,
  182.                                         arNoteID note, pBoolean doDeselect)
  183.         { calls->sel->SelectObject ( parent, field, note, doDeselect); };
  184.     inline Boolean        ObjectIsSelected( arNoteID parent, arFieldID field, arNoteID note )
  185.         { return calls->sel->ObjectIsSelected( parent, field, note); };
  186.     inline     Boolean     FlushSelection ( pBoolean alsoDrop)
  187.         { return calls->sel->FlushSelection ( alsoDrop); };
  188.     
  189.     inline     void         ShowPath ( arPathID path, pBoolean selectFlag,
  190.                                         Integer textSelStart, Integer textSelEnd)
  191.         { calls->sel->ShowPath ( path, selectFlag, textSelStart, textSelEnd); };
  192.     
  193.     inline     Integer     GetSelText ( Integer bufLen, void* buffer,
  194.                                         Integer *selStart, Integer *selEnd)
  195.         { return calls->sel->GetSelText ( bufLen, buffer, selStart, selEnd); };
  196.     inline     void         SetSelText ( const char* text, Integer textLen,
  197.                                         Integer selStart, Integer selEnd)
  198.         { calls->sel->SetSelText ( text, textLen, selStart, selEnd); };
  199.     
  200.     // Functions added in version 2 of SelCalls record
  201.     inline     void      ReplaceSelText ( const char* text, const char* undoName)
  202.         { calls->sel->ReplaceSelText ( text, undoName); };
  203.  
  204. /* The callback functions for searching, sorting, and filtering. */
  205.     
  206.     // Searching
  207.     inline Boolean NextAppearance ( arPathID path, arDirCode direction )
  208.         { return calls->search->NextAppearance( path, direction ); };
  209.     inline     Boolean FindText ( arPathID path, arDirCode direction,
  210.                                 Integer *selStart, Integer *selEnd,
  211.                                 const char* searchString, arSearchFlags flags)
  212.         { return calls->search->FindText ( path, direction, selStart, selEnd,
  213.                                             searchString, flags); };
  214.     
  215.     // Filtering and sorting
  216.     inline     arListID FilterList ( arListID list, arTypeID matchType, arFilterFlags flags,
  217.                                     pShort clauseCount, const arFilterClause* clauses)
  218.         { return calls->search->FilterList ( list, matchType, flags, clauseCount, clauses); };
  219.     inline     arListID FilterNotes ( arTypeID type, arFilterFlags flags,
  220.                                      pShort clauseCount, const arFilterClause* clauses)
  221.         { return calls->search->FilterNotes ( type, flags, clauseCount, clauses); };
  222.     inline     arListID SortNotes ( arListID list,
  223.                                  pShort clauseCount, const arSortClause* clauses)
  224.         { return calls->search->SortNotes ( list, clauseCount, clauses); };
  225.  
  226. /* The callback functions for creating and accessing system objects
  227.     (i.e. topics, note type definitions, and so forth). */
  228.     
  229.     // General calls
  230.     inline     arNoteID         GetBuiltInObject ( arBuiltInObject whichObject)
  231.         { return calls->sysObj->GetBuiltInObject ( whichObject); };
  232.     inline     arNoteID         LookupObjectName ( arObjectClass objClass,
  233.                                                 const char* name, pBoolean allowPartial)
  234.         { return calls->sysObj->LookupObjectName ( objClass, name, allowPartial); };
  235.     
  236.     // Topic/folder/view calls
  237.     inline     arTopicID     CreateTopic ( const char* name, arTopicID parent,
  238.                                          arTopicID successor, pBoolean makeView)
  239.         { return calls->sysObj->CreateTopic ( name, parent, successor, makeView); };
  240.     inline     arTopicID     CreateFolder ( const char* name, arTopicID successor)
  241.         { return calls->sysObj->CreateFolder ( name, successor); };
  242.     inline     void             UpdateView ( arTopicID view)
  243.         { calls->sysObj->UpdateView ( view); };
  244.     inline     void             GetTopicInfo ( arTopicID topic, arTopicInfo *info)
  245.         { calls->sysObj->GetTopicInfo ( topic, info); };
  246.     inline     void             SetTopicInfo ( arTopicID topic, const arTopicInfo *info)
  247.         { calls->sysObj->SetTopicInfo ( topic, info); };
  248.     
  249.     // Note type calls
  250.     inline     arTypeID    CreateNoteType ( const char* name, pBoolean userVisible)
  251.         { return calls->sysObj->CreateNoteType ( name, userVisible); };
  252.     inline    Integer        CountTypeInstances ( arTypeID type )
  253.         { return calls->sysObj->CountTypeInstances( type ); };
  254.     inline     arListID    GetTypeInstances ( arTypeID type)
  255.         { return calls->sysObj->GetTypeInstances ( type); };
  256.     inline     void        GetTypeInfo ( arTypeID type, arTypeInfo *info)
  257.         { calls->sysObj->GetTypeInfo ( type, info); };
  258.     inline     void        SetTypeInfo ( arTypeID type, const arTypeInfo *info)
  259.         { calls->sysObj->SetTypeInfo ( type, info); };
  260.     
  261.     // Field calls
  262.     inline     arFieldID     CreateField ( const char* name, arFieldType dataType,
  263.                                         pBoolean userVisible)
  264.         { return calls->sysObj->CreateField ( name, dataType, userVisible); };
  265.     inline     void             GetFieldInfo ( arFieldID field, arFieldInfo *info)
  266.         { calls->sysObj->GetFieldInfo ( field, info); };
  267.     inline     void             SetFieldInfo ( arFieldID field, const arFieldInfo *info)
  268.         { calls->sysObj->SetFieldInfo ( field, info); };
  269.     
  270.     // Window calls
  271.     inline     arWindowID     CreateWindow ( const char* name, const Rect *bounds)
  272.         { return calls->sysObj->CreateWindow ( name, bounds); };
  273.     inline     arTopicID     GetCurrentTopic ( arWindowID window, pBoolean returnRoot)
  274.         { return calls->sysObj->GetCurrentTopic ( window, returnRoot); };
  275.     inline Boolean        SetCurrentTopic    ( arWindowID window, arTopicID topic,
  276.                                             pBoolean useLastView )
  277.         { return calls->sysObj->SetCurrentTopic ( window, topic, useLastView); };
  278.     inline     Boolean         SelectWindow ( arWindowID window)
  279.         { return calls->sysObj->SelectWindow ( window); };
  280.     inline     void             GetWindInfo ( arWindowID window, arWindInfo *info)
  281.         { calls->sysObj->GetWindInfo ( window, info); };
  282.     inline     void             SetWindInfo ( arWindowID window, const arWindInfo *info)
  283.         { calls->sysObj->SetWindInfo ( window, info); };
  284.  
  285. /* The callback functions for manipulating arListIDs and arPathIDs. */
  286.     
  287.     // List access
  288.     inline     Integer     GetListLen ( arListID list)
  289.         { return calls->list->GetListLen ( list); };
  290.     inline     arNoteID     GetListEntry ( arListID list, Integer index)
  291.         { return calls->list->GetListEntry ( list, index); };
  292.     inline     Integer     GetListEntries ( arListID list, Integer index,
  293.                                         arNoteID* buffer, Integer bufSize)
  294.         { return calls->list->GetListEntries ( list, index, buffer, bufSize); };
  295.     inline     Integer     SearchList ( arListID list, arNoteID target)
  296.         { return calls->list->SearchList ( list, target); };
  297.     
  298.     // List editing
  299.     inline     void         SetListEntry ( arListID *list, Integer index, arNoteID entry)
  300.         { calls->list->SetListEntry ( list, index, entry); };
  301.     inline     void         SetListEntries ( arListID *list, Integer index,
  302.                                             const arNoteID* entries, Integer count)
  303.         { calls->list->SetListEntries ( list, index, entries, count); };
  304.     inline     void         InsertListEntry ( arListID *list, Integer index, arNoteID entry)
  305.         { calls->list->InsertListEntry ( list, index, entry); };
  306.     inline     void         InsertListEntries ( arListID *list, Integer index, Integer count)
  307.         { calls->list->InsertListEntries ( list, index, count); };
  308.     inline     void         DeleteListEntries ( arListID *list, Integer index, Integer count)
  309.         { calls->list->DeleteListEntries ( list, index, count); };
  310.     inline     void         ResizeList ( arListID *list, Integer newSize)
  311.         { calls->list->ResizeList ( list, newSize); };
  312.     
  313.     // Miscellaneous list operations
  314.     inline     arListID CreateList ( Integer length)
  315.         { return calls->list->CreateList ( length); };
  316.     inline     arListID DupList ( arListID list)
  317.         { return calls->list->DupList ( list); };
  318.     inline     void             DisposeList ( arListID list)
  319.         { calls->list->DisposeList (list); };
  320.     
  321.     // Path access
  322.     inline     arPathType GetPathInfo ( arPathID path, arNoteID *root)
  323.         { return calls->list->GetPathInfo ( path, root); };
  324.     inline     Integer     GetPathLen ( arPathID path)
  325.         { return calls->list->GetPathLen ( path); };
  326.     inline     arNoteID     GetPathEntry ( arPathID path, Integer index)
  327.         { return calls->list->GetPathEntry ( path, index); };
  328.     
  329.     // Path manipulation
  330.     inline     Boolean     PushPath ( arPathID path, arNoteID newEntry)
  331.         { return calls->list->PushPath ( path, newEntry); };
  332.     inline     void         PopPath ( arPathID path)
  333.         { calls->list->PopPath ( path); };
  334.     inline     Boolean     WalkPath ( arPathID path, arDirCode direction, arWalkCache* cache)
  335.         { return calls->list->WalkPath ( path, direction, cache); };
  336.     inline void        DisposeWalkCache ( arWalkCache cache )
  337.         { calls->list->DisposeWalkCache (cache); };
  338.     
  339.     // Miscellaneous path operations
  340.     inline     arPathID    PathToTopic ( arTopicID topic, pBoolean atEnd)
  341.         { return calls->list->PathToTopic ( topic, atEnd); };
  342.     inline     Boolean        EqualPaths ( arPathID path1, arPathID path2)
  343.         { return calls->list->EqualPaths ( path1, path2); };
  344.     inline     arPathID    DupPath ( arPathID path)
  345.         { return calls->list->DupPath ( path); };
  346.     inline     void        DisposePath ( arPathID path)
  347.         { calls->list->DisposePath ( path); };
  348.  
  349. /* The callback functions for manipulating the display state
  350.     (scrolling, opening and closing notes, etc.). */
  351.     
  352.     inline arNoteState    GetNoteState ( arNoteID note, arNoteID parentNote )
  353.         { return calls->view->GetNoteState ( note, parentNote ); };
  354.     inline     void        SetNoteState ( arNoteID note, arNoteID parentNote,
  355.                                         arNoteState newState)
  356.         { calls->view->SetNoteState ( note, parentNote, newState); };
  357.  
  358. /* The callback functions for document-level operations
  359.     (e.g. opening, closing and saving documents). */
  360.     
  361.     inline arDocumentPtr    GetCurrentDoc ()
  362.         { return    calls->doc->GetCurrentDoc (); };
  363.     inline     void            SetCurrentDoc (arDocumentPtr newDoc)
  364.         { calls->doc->SetCurrentDoc (newDoc); };
  365.     
  366.     inline Integer            CountOpenDocs ()
  367.         { return calls->doc->CountOpenDocs (); };
  368.     inline     arDocumentPtr GetIndexedDoc (Integer index)
  369.         { return calls->doc->GetIndexedDoc (index); };
  370.     inline arDocumentPtr    GetPrefsDoc ()
  371.         { return calls->doc->GetPrefsDoc (); };
  372.     
  373.     inline     void             GetDocInfo (arDocInfo *info)
  374.         { calls->doc->GetDocInfo (info); };
  375.     
  376.     inline     arDocumentPtr NewDoc ( const FSSpec* stationeryFile, const char* title )
  377.         { return calls->doc->NewDoc ( stationeryFile, title ); };
  378.     inline     arDocumentPtr Open ( const FSSpec* srcFile, pBoolean readOnly)
  379.         { return calls->doc->Open ( srcFile, readOnly); };
  380.     inline    void          Close    ()
  381.         { calls->doc->Close (); };
  382.     
  383.     inline    arFileOpResult    Save ()
  384.         { return calls->doc->Save (); };
  385.     inline     arFileOpResult    SaveAs (const FSSpec* targetFile)
  386.         { return calls->doc->SaveAs (targetFile); };
  387.     inline     arFileOpResult    Revert ()
  388.         { return calls->doc->Revert (); };
  389.     
  390.     inline     Integer    GetGlobalData  ( const char* name, Integer bufLen, void* buffer)
  391.         { return calls->doc->GetGlobalData ( name, bufLen, buffer ); };
  392.     inline    void    SetGlobalData  ( const char* name, const void* data, Integer dataLen,
  393.                                      pBoolean isText)
  394.         { calls->doc->SetGlobalData  ( name, data, dataLen, isText); };
  395.     inline    Boolean    BringCurDocToFront ()
  396.         { return calls->doc->BringCurDocToFront (); };
  397.     inline    void    SetChangedFlag ()
  398.         { calls->doc->SetChangedFlag (); };
  399.     inline     void    SetupUndo ( const char* operationName, pBoolean setChangedFlag)
  400.         { calls->doc->SetupUndo ( operationName, setChangedFlag); };
  401.     
  402.     inline     void    OpenHiddenDoc ( const FSSpec* srcFile, pBoolean readOnly,
  403.                                     arDocumentPtr* doc, Boolean* closeWhenFinished)
  404.         { calls->doc->OpenHiddenDoc ( srcFile, readOnly, doc, closeWhenFinished); };
  405.  
  406. /* The callback functions for accessing and extending
  407.     Arrange's import & export capabilities. */
  408.  
  409.     inline     Boolean ImportTAIL (const FSSpec* srcFile,    arTopicID destTopic)
  410.         { return calls->io->ImportTAIL (srcFile, destTopic); };
  411.     inline     Boolean ExportTAIL (const FSSpec* targetFile, arTopicID srcTopic )
  412.         { return calls->io->ExportTAIL (targetFile, srcTopic ); };
  413.  
  414. /* The callback functions for customizing the Arrange user interface. */
  415.     
  416.     inline     void AddMenu ( const char* menuName, pShort menuCode, arMenuID parentCode)
  417.         { calls->ui->AddMenu ( menuName, menuCode, parentCode); };
  418.     inline     void AddMenuItem ( pShort menuCode, const char* itemName, pShort cmdChar,
  419.                                 Integer commandCode, Integer itemRefcon)
  420.         { calls->ui->AddMenuItem ( menuCode, itemName, cmdChar, commandCode, itemRefcon); };
  421.     inline     void DeleteMenuItem ( pShort menuCode, Integer commandCode, Integer itemRefcon)
  422.         { calls->ui->DeleteMenuItem ( menuCode, commandCode, itemRefcon); };
  423.     inline     void SetMenuItem ( pShort menuCode, Integer commandCode, Integer itemRefcon,
  424.                                 const char* itemName, pBoolean itemEnabled,
  425.                                 pShort markChar, pShort itemStyle)
  426.         { calls->ui->SetMenuItem ( menuCode, commandCode, itemRefcon, itemName,
  427.                                     itemEnabled, markChar, itemStyle); };
  428.     
  429.     inline     void SetClickHook ( ClickHook hook, uInteger refcon, pBoolean addHook)
  430.         { calls->ui->SetClickHook ( hook, refcon, addHook); };
  431.     inline     void SetMenuHook ( MenuHook hook, uInteger refcon, pBoolean addHook,
  432.                                 Integer commandCode)
  433.         { calls->ui->SetMenuHook ( hook, refcon, addHook, commandCode); };
  434.     inline     void SetKeyHook ( KeyHook hook, uInteger refcon, pBoolean addHook,
  435.                                 pShort charFilter, pShort keyFilter, pShort modFilter)
  436.         { calls->ui->SetKeyHook ( hook, refcon, addHook, charFilter, keyFilter, modFilter); };
  437.     inline     void SetFieldHook ( FieldHook hook, uInteger refcon, pBoolean addHook,
  438.                                 arFieldID field)
  439.         { calls->ui->SetFieldHook ( hook, refcon, addHook, field); };
  440.     inline     void SetTopicHook ( TopicHook hook, uInteger refcon, pBoolean addHook)
  441.         { calls->ui->SetTopicHook ( hook, refcon, addHook); };
  442.     inline     void SetTickHook ( TickHook  hook, uInteger refcon, pBoolean addHook)
  443.         { calls->ui->SetTickHook ( hook, refcon, addHook); };
  444.     inline     void SetFileHook ( FileHook  hook, uInteger refcon, pBoolean addHook)
  445.         { calls->ui->SetFileHook ( hook, refcon, addHook); };
  446.     inline     void SetQuitHook ( QuitHook  hook, uInteger refcon, pBoolean addHook)
  447.         { calls->ui->SetQuitHook ( hook, refcon, addHook); };
  448.     
  449.     inline     void SetATMHook ( AboutToMenuHook hook, uInteger refcon, pBoolean addHook)
  450.         { calls->ui->SetATMHook ( hook, refcon, addHook); };
  451.     
  452.     inline     void RegisterImportFormat ( const char* name, Integer formatID,
  453.                                         OSType* fileTypes, Integer fileTypeCount,
  454.                                         ImportHook hook, uInteger refcon)
  455.         { calls->ui->RegisterImportFormat ( name, formatID, fileTypes, fileTypeCount,
  456.                                             hook, refcon); };
  457.     
  458.     inline     void RegisterExportFormat ( const char* name, Integer formatID,
  459.                                         arEFType type, ExportHook hook,
  460.                                         uInteger refcon, OSType fileType,
  461.                                         OSType fileCreator)
  462.         { calls->ui->RegisterExportFormat ( name, formatID, type, hook, refcon,
  463.                                             fileType, fileCreator); };
  464.     
  465.     inline    void RegisterFieldProc( const char* name, Integer id, arFPType type,
  466.                                     Integer fieldTypes, FieldHook proc, uInteger refcon)
  467.         { calls->ui->RegisterFieldProc ( name, id, type, fieldTypes, proc, refcon ); };
  468.     inline     Boolean TestFieldProc ( arFieldID field, arFPType type, Integer procID)
  469.         { return calls->ui->TestFieldProc ( field, type, procID); };
  470.  
  471. /* The callback functions for displaying dialogs and progress indicators. */
  472.  
  473.     inline     void     StopAlert ( const char* message)
  474.         { calls->dlg->StopAlert ( message); };
  475.     inline     Boolean OKCancelAlert ( const char* message)
  476.         { return calls->dlg->OKCancelAlert ( message); };
  477.     inline     Boolean PromptForString ( const char* prompt, char* string,
  478.                                         pShort maxLen, pBoolean numbersOnly)
  479.         { return calls->dlg->PromptForString ( prompt, string, maxLen, numbersOnly); };
  480.     
  481.     inline     Boolean PromptForField ( const char* prompt, arFieldID* field,
  482.                                      const arFieldType* allowedTypes,
  483.                                      arChoiceDialogFlags flags)
  484.         { return calls->dlg->PromptForField ( prompt, field, allowedTypes, flags); };
  485.     inline     Boolean PromptForType ( const char* prompt, arTypeID* type,
  486.                                     arChoiceDialogFlags flags)
  487.         { return calls->dlg->PromptForType ( prompt, type, flags); };
  488.     
  489.     inline     void    DisplayNotify (const char* message, arNotifyFlags flags)
  490.         { calls->dlg->DisplayNotify (message, flags); };
  491.     inline void        ClearNotify ()
  492.         { calls->dlg->ClearNotify (); };
  493.     inline     void    SetNotifyText (const char* newMessage)
  494.         { calls->dlg->SetNotifyText (newMessage); };
  495.     
  496.     inline     Boolean TickNotify (Integer amountDone, Integer totalAmount)
  497.         { return calls->dlg->TickNotify (amountDone, totalAmount); };
  498.     
  499.     inline    void    BackgroundTick ()
  500.         { calls->dlg->BackgroundTick (); };
  501.  
  502. /* End of the inline function definitions for Arrange's callbacks */